package Connection;

import java.sql.Connection;
import java.sql.DriverManager;
/*
public class Connection.DAOBase implements Connection.DAO {
    @Override
    public Connection getConnection() {
        String URL="jdbc:sqlserver://localhost:1433;DatabaseName=achievement";
        Connection con = null;
        try{
            Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
            con = DriverManager.getConnection(URL,"zry","123");
        }catch (Exception ex){
            ex.printStackTrace();
        }
        return con;
    }
}
*/

public class DAOBase implements DAO {
    @Override
    public Connection getConnection() {
        String URL="jdbc:sqlserver://localhost:1433;DatabaseName=DatabaseProject";
        Connection con = null;
        try{
            Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
            con = DriverManager.getConnection(URL,"zry","123");
        }catch (Exception ex){
            ex.printStackTrace();
        }
        return con;
    }
}